<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:awc="clr-namespace:Assergs.Windows.Controls"
    xmlns:aw="clr-namespace:Assergs.Windows"
	>

    <SolidColorBrush x:Key="NormalBorderBrush" Color="{x:Static aw:ListBoxPallet.NormalBorder}"/>
    <SolidColorBrush x:Key="WindowBackgroundBrush" Color="{x:Static aw:ListBoxPallet.WindowBackground}"/>
    <SolidColorBrush x:Key="DisabledBorderBrush" Color="{x:Static aw:ListBoxPallet.DisabledBorder}"/>
    
    <LinearGradientBrush x:Key="DisableBackGroundBrush">
        <GradientStop Color="{x:Static aw:ListBoxPallet.DisableBackGround1}"/>
        <GradientStop Color="{x:Static aw:ListBoxPallet.DisableBackGround2}"/>
    </LinearGradientBrush>

    <Style x:Key="{x:Type ListBox}" TargetType="ListBox">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="MinWidth" Value="120"/>
        <Setter Property="MinHeight" Value="95"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBox">
                    <Border
                      Name="Border"
                      Background="{StaticResource WindowBackgroundBrush}"
                      BorderBrush="{StaticResource NormalBorderBrush}"
                      BorderThickness="1"
                      CornerRadius="2">
                        <ScrollViewer
                          Margin="0"
                          Focusable="false">
                            <StackPanel Margin="2" IsItemsHost="True" />
                        </ScrollViewer>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource DisableBackGroundBrush}" />
                            <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
                        </Trigger>
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>